From: Carlos Garnacho Date: Sat, 9 Aug 2025 07:43:11 +0000 (+0200) Subject: slider: Always use physical direction on smooth scroll X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~104^2^2~86 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=9ce5e14635b1b6b431d612d85977ab5c49a024e3;p=gnome-shell.git slider: Always use physical direction on smooth scroll Let the slider use the physical scroll direction, unaffected by "natural scroll" settings. These widgets are not a "view" where this setting does make sense, but rather the expectation is that it's directly manipulable. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/1012 Closes: https://bugzilla.gnome.org/show_bug.cgi?id=703046 Part-of: --- diff --git a/js/ui/slider.js b/js/ui/slider.js index 6b09b4c40..29c17500e 100644 --- a/js/ui/slider.js +++ b/js/ui/slider.js @@ -161,10 +161,11 @@ export const Slider = GObject.registerClass({ } else if (direction === Clutter.ScrollDirection.UP) { delta = SLIDER_SCROLL_STEP; } else if (direction === Clutter.ScrollDirection.SMOOTH) { - let [, dy] = event.get_scroll_delta(); - // Even though the slider is horizontal, use dy to match - // the UP/DOWN above. - delta = -dy * SLIDER_SCROLL_STEP; + let [dx] = event.get_scroll_delta(); + delta = dx * SLIDER_SCROLL_STEP; + // Match physical direction + if (event.get_scroll_flags() & Clutter.ScrollFlags.INVERTED) + delta *= -1; } this.value = Math.min(Math.max(0, this._value + delta), this._maxValue);